GtkPlacesSidebar: Fix Home and Desktop on Windows.
authorMatias De Lellis <mati86dl@gmail.com>
Mon, 1 Dec 2014 20:56:05 +0000 (14:56 -0600)
committerFederico Mena Quintero <federico@gnome.org>
Mon, 1 Dec 2014 20:57:32 +0000 (14:57 -0600)
We were concatenating "file://" to the result of g_get_user_special_dir() to build
a URI, but this is not enough on Windows.  Use g_filename_to_uri() instead.

See https://bugzilla.gnome.org/show_bug.cgi?id=739453

gtk/gtkplacessidebar.c

index 6b9555102b0f14899907e528d7a8b6cf1e056d3d..80426a33cc5806b418da4748b80b6980505208ea 100644 (file)
@@ -690,7 +690,7 @@ get_home_directory_uri (void)
   if (!home)
     return NULL;
 
-  return g_strconcat ("file://", home, NULL);
+  return g_filename_to_uri (home, NULL, NULL);
 }
 
 static gchar *
@@ -706,7 +706,7 @@ get_desktop_directory_uri (void)
   if (path_is_home_dir (name))
     return NULL;
 
-  return g_strconcat ("file://", name, NULL);
+  return g_filename_to_uri (name, NULL, NULL);
 }
 
 static gboolean